/*  IRRADIA
 *
 * RASCONNECT:  modulo para la conexion de irradia a las librerias RASC de SGI
 *
 *  the module was dessigned to implement the algorithms which implements intersections
 *  between objects and rays.
 */
#ifndef __RASCONNECT
#define __RASCONNECT

/****************************** TYPES ********************************/

typedef struct{
	int code;
	char alg_name[11];
}t_alg_def;

typedef struct{
	void *next;
	void *ptr;
	int alg_ids;
}t_mem_ptr;

typedef struct{
	void *next;
	int  alg_id;
	int  num;
	char name[11];
}t_alg_ids;

typedef struct{
	t_alg_ids *ids;
	t_mem_ptr *mems;
}t_rasconnect_control;

/****************************** RETURN CODES **************************/

#define RASCONNECT_ERROR_NOT_IMPLEMENTED -1
#define RASCONNECT_ERROR_MEMORY          -2
#define RASCONNECT_ERROR_RASCLIB         -3

#define RASCONNECT_SUCCESS                0


/***************************** FUNCTIONS PROTOTIPES *******************/

void rcnc_init ();

int rcnc_monta_entorno   (int numFPGAS, int alg_code);

int rcnc_load_objs       (int alg_code, object *objs, int num);
int rcnc_load_ray        (int alg_code, ray    *rayo);
int rcnc_go              (int alg_code);
int rcnc_wait            (int alg_code);
int rcnc_set_result_ptr  (int alg_code, void *buffer, int num);

int rcnc_desmonta_entorno(int alg_code);

void rcnc_close_all();

#endif
